package com.book.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.book.dao.WriteMapper;
import com.book.domain.Friend;
import com.book.domain.Heart;
import com.book.domain.Write;

@Service
public class WriteServiceImpl implements WriteService {
	
	@Autowired
	private WriteMapper writeMapper;

	@Override
	public void insertWrite(Write write) {		
		writeMapper.insertWrite(write);
	}

	@Override
	public List<Write> tagMatchingSelect(Write write) {		
		System.out.println("tag Service Author"+write.getbBookAuthor());
		System.out.println("tag Service Genre"+write.getbBookGenre());
		System.out.println("tag Service Title"+write.getbBookTitle());
		System.out.println("tag Service Emotion"+write.getbEmotion());
		System.out.println("tag Service mCode"+write.getmCode());
		
		return writeMapper.tagMatchingSelect(write);
	}

	@Override
	public Heart heartCount(Heart heart) {		
		return writeMapper.heartCount(heart);
	}

	@Override
	public void insertHeart(Heart heart) {
		writeMapper.insertHeart(heart);		
	}
	
	@Override
	public List<Friend> selectGetNick(List<String> list) {
		System.out.println("list tostring" +list.toString());
		return writeMapper.selectGetNick(list);
	}
	
	
}
